// pages/mch/income/index.js
const App = getApp()
import Kits from '../../../utils/kits'

Page({
  data: {
    init: false,
    loading: false,
    triggered: true,
    CustomBar: App.Global.CustomBar,

    pager: {
      now: 1,
      row: 0,
      all: 0,
      fms: 0,
    },
    items: [],
    tab:0,
    three:1,
    longitude: '120.027412',
    latitude: '36.271277'
  },
  mapA(e) {
    console.log(e.detail,"erewgg")
    this.setData({
      longitude:e.detail.longitude,
      latitude:e.detail.latitude
    })
  },
  changeTab(e) {
    this.setData({
      tab: e.currentTarget.dataset.tab
    })
  },
  onLoad() {
  
    this.execLoad(false)
    this.getData()
  },
  getData() {
    App.doPost({
      uri: '/ops/sys/car/model/brand',
      fnSucc: (res) => {
        console.log(res,"fefret");
      }
    })
  },
  selectThree(e){
    this.setData({
      three:e.currentTarget.dataset.three
    })
  },
  goDetail(){
    console.log('调')
    wx.navigateTo({
      url: '/pages/mch/income/detail',
    })
  },

  doPulldown() {
    this.execLoad(true)
  },
  
  doReachBottom() {
    if (this.data.page >= this.data.pager.all) {
      return
    }
    this.data.page = this.data.page + 1
    this.execLoad(true)
  },
  doDateChange(e) {
    if (e.currentTarget.dataset.type == 'begin') {
      this.setData({
        begin: e.detail.value
      })
    } else {
      this.setData({
        close: e.detail.value
      })
    }
    this.execLoad(false)
  },
  toPage(e) {
    wx.navigateTo({
      url: e.currentTarget.dataset.uri
    })
  },
  execLoad(pulldown) {
    // this.setData({
    //   loading: true
    // })
    // App.doPost({
    //   uri: '/ops/sys/car/model/brand',
    //   body: {
    //   },
    //   fnSucc: resp => {
    //    console.log(resp)
    //   },
    //   fnComp: () => {
       
    //   }
    // })
  }
})